#pragma once

#include "Camera.hpp"

class TargetCamera : public Camera{
public:

	glm::vec3 eye = glm::vec3(0.0f,0.0f,2.5f);
	
	glm::vec3 center = glm::vec3(0.0f,0.0f,0.0f);
	
	glm::vec3 up = glm::vec3(0.0f,1.0f,0.0f);
	
	GLfloat fovy = 45.0f;
	
	GLfloat zNear = 0.001f;
	
	GLfloat zFar = 1000.0f;
	
	virtual const glm::mat4 getMatrix() const;
	
	virtual const glm::vec3 getPosition() const;
	
};

const glm::vec3 TargetCamera::getPosition() const{
	return eye;
}

const glm::mat4 TargetCamera::getMatrix() const{
	GLint viewport[4];
	glGetIntegerv(GL_VIEWPORT,viewport);
	return glm::perspective(
		fovy,
		(float)viewport[2]/viewport[3],
		zNear,
		zFar
	) * glm::lookAt(eye,center,up);
}
